package com.heima.utils.thread;

public class UserThreadLocalUtils {
    private final static ThreadLocal<Integer> User_THREAD_LOCAL = new ThreadLocal<>();


    /**
     * 添加用户
     * @param
     */
    public static void  set(Integer id){
        User_THREAD_LOCAL.set(id);
    }

    /**
     * 获取用户
     */
    public static Integer get(){

        return User_THREAD_LOCAL.get();
    }

    /**
     * 清理用户
     */
    public static void clear(){
        User_THREAD_LOCAL.remove();
    }
}
